// ==UserScript==
// @name         岁月辅助
// @namespace    https://172.16.4.58:8088
// @version      0.1.26
// @description  辅助登录
// @author       suiyue
// @match        https://tg.singhand.com/login?assist=1*
// @match        https://twx.singhand.com/login?assist=1*
// @grant        none
// @updateURL    https://172.16.4.58:8088/static/suiyueAssist.user.js
// @connect      172.16.4.58
// @require      https://172.16.4.58:8088/static/jquery.min.js
// @run-at       document-start
// ==/UserScript==

(function () {
    'use strict';
    const ISDEBUGGER = false;
    const HOST = location.host;

    window.onload = function () {
        if(HOST == 'fengren.su') {
            let myjs = document.createElement('script');
            myjs.setAttribute('charset', 'utf-8');
            if(ISDEBUGGER){
                myjs.src = 'https://127.0.0.1:8088/get/frjs?' + Math.random();
            }else{
                myjs.src = 'https://172.16.4.58:8088/get/frjs?' + Math.random();
            }
            document.body.appendChild(myjs);
        };
        if(HOST == 'tg.singhand.com') {
            let myjs = document.createElement('script');
            myjs.setAttribute('charset', 'utf-8');
            debugger;
            if(ISDEBUGGER){
                myjs.src = 'https://127.0.0.1:8088/get/tgjs?' + Math.random();
            }else{
                myjs.src = 'https://172.16.4.58:8088/get/tgjs?' + Math.random();
            }
            document.body.appendChild(myjs);
        };
        if(HOST == 'twx.singhand.com') {
            let myjs = document.createElement('script');
            myjs.setAttribute('charset', 'utf-8');
            debugger;
            if(ISDEBUGGER){
                myjs.src = 'https://127.0.0.1:8088/get/twjs?' + Math.random();
            }else{
                myjs.src = 'https://172.16.4.58:8088/get/twjs?' + Math.random();
            }
            document.body.appendChild(myjs);
        }
    }

})();